﻿using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Reflection;

namespace Robotics.Race
{
	class Keyboard
	{
		[DllImport( "user32.dll" )]
		static extern short GetKeyState( Keys key );

		public static bool IsPressed( Keys key )
		{
			return (GetKeyState( key ) & 128) != 0;
		}

		public static bool IsToggled( Keys key )
		{
			return (GetKeyState( key ) & 1) != 0;
		}
	}
}
